Your first neural network

In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code, but left the implementation of the neural network up to you (for the most part). After you've submitted this project, feel free to explore the data and the model more.


In [1]:
%matplotlib inline
#%config InlineBackend.figure_format = 'retina'

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

import pandas as pd
import numpy as np
import tensorflow as tf
import tflearn
from tflearn.data_utils import to_categorical

Load and prepare the data

A critical step in working with neural networks is preparing the data correctly. Variables on different scales make it difficult for the network to efficiently learn the correct weights. Below, we've written the code to load and prepare the data. You'll learn more about this soon!


In [2]:
data_path = 'Bike-Sharing-Dataset/hour.csv'

rides = pd.read_csv(data_path)

In [3]:
rides.head()


Out[3]:
instant dteday season yr mnth hr holiday weekday workingday weathersit temp atemp hum windspeed casual registered cnt
0 1 2011-01-01 1 0 1 0 0 6 0 1 0.24 0.2879 0.81 0.0 3 13 16
1 2 2011-01-01 1 0 1 1 0 6 0 1 0.22 0.2727 0.80 0.0 8 32 40
2 3 2011-01-01 1 0 1 2 0 6 0 1 0.22 0.2727 0.80 0.0 5 27 32
3 4 2011-01-01 1 0 1 3 0 6 0 1 0.24 0.2879 0.75 0.0 3 10 13
4 5 2011-01-01 1 0 1 4 0 6 0 1 0.24 0.2879 0.75 0.0 0 1 1

Checking out the data

This dataset has the number of riders for each hour of each day from January 1 2011 to December 31 2012. The number of riders is split between casual and registered, summed up in the cnt column. You can see the first few rows of the data above.

Below is a plot showing the number of bike riders over the first 10 days or so in the data set. (Some days don't have exactly 24 entries in the data set, so it's not exactly 10 days.) You can see the hourly rentals here. This data is pretty complicated! The weekends have lower over all ridership and there are spikes when people are biking to and from work during the week. Looking at the data above, we also have information about temperature, humidity, and windspeed, all of these likely affecting the number of riders. You'll be trying to capture all this with your model.


In [4]:
rides[:24*10].plot(x='dteday', y='cnt')
plt.show()


Dummy variables

Here we have some categorical variables like season, weather, month. To include these in our model, we'll need to make binary dummy variables. This is simple to do with Pandas thanks to get_dummies().


In [5]:
dummy_fields = ['season', 'weathersit', 'mnth', 'hr', 'weekday']
for each in dummy_fields:
    dummies = pd.get_dummies(rides[each], prefix=each, drop_first=False)
    rides = pd.concat([rides, dummies], axis=1)

fields_to_drop = ['instant', 'dteday', 'season', 'weathersit', 
                  'weekday', 'atemp', 'mnth', 'workingday', 'hr']
data = rides.drop(fields_to_drop, axis=1)
data.head()


Out[5]:
yr holiday temp hum windspeed casual registered cnt season_1 season_2 ... hr_21 hr_22 hr_23 weekday_0 weekday_1 weekday_2 weekday_3 weekday_4 weekday_5 weekday_6
0 0 0 0.24 0.81 0.0 3 13 16 1 0 ... 0 0 0 0 0 0 0 0 0 1
1 0 0 0.22 0.80 0.0 8 32 40 1 0 ... 0 0 0 0 0 0 0 0 0 1
2 0 0 0.22 0.80 0.0 5 27 32 1 0 ... 0 0 0 0 0 0 0 0 0 1
3 0 0 0.24 0.75 0.0 3 10 13 1 0 ... 0 0 0 0 0 0 0 0 0 1
4 0 0 0.24 0.75 0.0 0 1 1 1 0 ... 0 0 0 0 0 0 0 0 0 1

5 rows × 59 columns

Scaling target variables

To make training the network easier, we'll standardize each of the continuous variables. That is, we'll shift and scale the variables such that they have zero mean and a standard deviation of 1.

The scaling factors are saved so we can go backwards when we use the network for predictions.


In [6]:
quant_features = ['casual', 'registered', 'cnt', 'temp', 'hum', 'windspeed']
# Store scalings in a dictionary so we can convert back later
scaled_features = {}
for each in quant_features:
    mean, std = data[each].mean(), data[each].std()
    scaled_features[each] = [mean, std]
    data.loc[:, each] = (data[each] - mean)/std

Splitting the data into training, testing, and validation sets

We'll save the data for the last approximately 21 days to use as a test set after we've trained the network. We'll use this set to make predictions and compare them with the actual number of riders.


In [7]:
# Save data for approximately the last 21 days 
test_data = data[-21*24:]

# Now remove the test data from the data set 
data = data[:-21*24]

# Separate the data into features and targets
target_fields = ['cnt', 'casual', 'registered']
features, targets = data.drop(target_fields, axis=1), data[target_fields]
test_features, test_targets = test_data.drop(target_fields, axis=1), test_data[target_fields]

We'll split the data into two sets, one for training and one for validating as the network is being trained. Since this is time series data, we'll train on historical data, then try to predict on future data (the validation set).


In [8]:
# Hold out the last 60 days or so of the remaining data as a validation set
train_features, train_targets = features[:-60*24], targets[:-60*24]
val_features, val_targets = features[-60*24:], targets[-60*24:]

Time to build the network

Below you'll build your network. We've built out the structure and the backwards pass. You'll implement the forward pass through the network. You'll also set the hyperparameters: the learning rate, the number of hidden units, and the number of training passes.

The network has two layers, a hidden layer and an output layer. The hidden layer will use the sigmoid function for activations. The output layer has only one node and is used for the regression, the output of the node is the same as the input of the node. That is, the activation function is $f(x)=x$. A function that takes the input signal and generates an output signal, but takes into account the threshold, is called an activation function. We work through each layer of our network calculating the outputs for each neuron. All of the outputs from one layer become inputs to the neurons on the next layer. This process is called forward propagation.

We use the weights to propagate signals forward from the input to the output layers in a neural network. We use the weights to also propagate error backwards from the output back into the network to update our weights. This is called backpropagation.

Hint: You'll need the derivative of the output activation function ($f(x) = x$) for the backpropagation implementation. If you aren't familiar with calculus, this function is equivalent to the equation $y = x$. What is the slope of that equation? That is the derivative of $f(x)$.

Below, you have these tasks:

  1. Implement the sigmoid function to use as the activation function. Set self.activation_function in __init__ to your sigmoid function.
  2. Implement the forward pass in the train method.
  3. Implement the backpropagation algorithm in the train method, including calculating the output error.
  4. Implement the forward pass in the run method.

In [15]:
tf.GPUOptions().per_process_gpu_memory_fraction


Out[15]:
0.0

In [130]:
class NeuralNetwork(object):
    def __init__(self, input_nodes, hidden_nodes, output_nodes, learning_rate, hidden_layers=1):
        # Set number of nodes in input, hidden and output layers.
        self.input_nodes = input_nodes
        self.hidden_nodes = hidden_nodes
        self.output_nodes = output_nodes
        self.hidden_layers = hidden_layers


        self.lr = learning_rate
        tf.reset_default_graph()
        
        self.net = tflearn.input_data([None, self.input_nodes])
        for i in range(self.hidden_layers):
            self.net = tflearn.fully_connected(self.net, self.hidden_nodes, activation='ReLU')
        self.net = tflearn.fully_connected(self.net, self.output_nodes, activation='linear')
        self.net = tflearn.regression(self.net, optimizer='sgd', learning_rate=self.lr,
                                      loss='mean_square')
        self.model=tflearn.DNN(self.net)
    
    def train(self, X, y, Xval,yval, n_epoch):
        print(X.shape,'\n',y.shape)
        self.model.fit(X, y, batch_size=128, n_epoch=n_epoch, validation_set=(Xval,yval))
        
    def run(self, features):
        return np.array(self.model.predict(features))

In [75]:
def MSE(y, Y):
    return np.mean((y-Y)**2)

Unit tests

Run these unit tests to check the correctness of your network implementation. This will help you be sure your network was implemented correctly befor you starting trying to train it. These tests must all be successful to pass the project.

import unittest inputs = np.array([[0.5, -0.2, 0.1]]) targets = np.array([[0.4]]) test_w_i_h = np.array([[0.1, -0.2], [0.4, 0.5], [-0.3, 0.2]]) test_w_h_o = np.array([[0.3], [-0.1]]) class TestMethods(unittest.TestCase): ########## # Unit tests for data loading ########## def test_data_path(self): # Test that file path to dataset has been unaltered self.assertTrue(data_path.lower() == 'bike-sharing-dataset/hour.csv') def test_data_loaded(self): # Test that data frame loaded self.assertTrue(isinstance(rides, pd.DataFrame)) ########## # Unit tests for network functionality ########## def test_activation(self): network = NeuralNetwork(3, 2, 1, 0.5) # Test that the activation function is a sigmoid self.assertTrue(np.all(network.activation_function(0.5) == 1/(1+np.exp(-0.5)))) def test_train(self): # Test that weights are updated correctly on training network = NeuralNetwork(3, 2, 1, 0.5) network.weights_input_to_hidden = test_w_i_h.copy() network.weights_hidden_to_output = test_w_h_o.copy() network.train(inputs, targets) self.assertTrue(np.allclose(network.weights_hidden_to_output, np.array([[ 0.37275328], [-0.03172939]]))) self.assertTrue(np.allclose(network.weights_input_to_hidden, np.array([[ 0.10562014, -0.20185996], [0.39775194, 0.50074398], [-0.29887597, 0.19962801]]))) def test_run(self): # Test correctness of run method network = NeuralNetwork(3, 2, 1, 0.5) network.weights_input_to_hidden = test_w_i_h.copy() network.weights_hidden_to_output = test_w_h_o.copy() self.assertTrue(np.allclose(network.run(inputs), 0.09998924)) suite = unittest.TestLoader().loadTestsFromModule(TestMethods()) unittest.TextTestRunner().run(suite)

Training the network

Here you'll set the hyperparameters for the network. The strategy here is to find hyperparameters such that the error on the training set is low, but you're not overfitting to the data. If you train the network too long or have too many hidden nodes, it can become overly specific to the training set and will fail to generalize to the validation set. That is, the loss on the validation set will start increasing as the training set loss drops.

You'll also be using a method know as Stochastic Gradient Descent (SGD) to train the network. The idea is that for each training pass, you grab a random sample of the data instead of using the whole data set. You use many more training passes than with normal gradient descent, but each pass is much faster. This ends up training the network more efficiently. You'll learn more about SGD later.

Choose the number of iterations

This is the number of batches of samples from the training data we'll use to train the network. The more iterations you use, the better the model will fit the data. However, if you use too many iterations, then the model with not generalize well to other data, this is called overfitting. You want to find a number here where the network has a low training loss, and the validation loss is at a minimum. As you start overfitting, you'll see the training loss continue to decrease while the validation loss starts to increase.

Choose the learning rate

This scales the size of weight updates. If this is too big, the weights tend to explode and the network fails to fit the data. A good choice to start at is 0.1. If the network has problems fitting the data, try reducing the learning rate. Note that the lower the learning rate, the smaller the steps are in the weight updates and the longer it takes for the neural network to converge.

Choose the number of hidden nodes

The more hidden nodes you have, the more accurate predictions the model will make. Try a few different numbers and see how it affects the performance. You can look at the losses dictionary for a metric of the network performance. If the number of hidden units is too low, then the model won't have enough space to learn and if it is too high there are too many options for the direction that the learning can take. The trick here is to find the right balance in number of hidden units you choose.


In [80]:
tf.reset_default_graph()

In [77]:
X = np.array(train_features)
y = np.array(train_targets['cnt']).reshape(-1,1)
Xval = np.array(val_features)
Yval = np.array(val_targets['cnt']).reshape(-1,1)

In [ ]:


In [78]:
y.shape


Out[78]:
(15435, 1)

In [81]:
network = NeuralNetwork(N_i, hidden_nodes, output_nodes, learning_rate)
network.train(X, y, Xval, Yval, 100)


Training Step: 12099  | total loss: 0.05481 | time: 0.379s
| SGD | epoch: 100 | loss: 0.05481 -- iter: 15360/15435
Training Step: 12100  | total loss: 0.05511 | time: 1.385s
| SGD | epoch: 100 | loss: 0.05511 | val_loss: 0.15991 -- iter: 15435/15435
--

In [73]:
import sys

### Set the hyperparameters here ###
iterations = 5000
learning_rate = 0.3
hidden_nodes = 9
output_nodes = 1

N_i = train_features.shape[1]
network = NeuralNetwork(N_i, hidden_nodes, output_nodes, learning_rate)

losses = {'train':[], 'validation':[]}
for ii in range(iterations):
    # Go through a random batch of 128 records from the training data set
    batch = np.random.choice(train_features.index, size=128)
    X, y = np.array(train_features.ix[batch].values), np.array(train_targets.ix[batch]['cnt'])
    Xval, yval = np.array(val_features.values), np.array(val_targets['cnt'])
    
    y = y.reshape(-1,1)
    yval = yval.reshape(-1,1)
                             
    network.train(X, y, Xval, yval)
    
    # Printing out the training progress
    train_loss = MSE(network.run(train_features).T, train_targets['cnt'].values)
    val_loss = MSE(network.run(val_features).T, val_targets['cnt'].values)
    sys.stdout.write("\rProgress: {:2.1f}".format(100 * ii/float(iterations)) \
                     + "% ... Training loss: " + str(train_loss)[:5] \
                     + " ... Validation loss: " + str(val_loss)[:5])
    sys.stdout.flush()
    
    losses['train'].append(train_loss)
    losses['validation'].append(val_loss)


(128, 56) 
 (128, 1)
---------------------------------
Run id: IZIMPZ
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 1  | time: 1.042s
| SGD | epoch: 001 | loss: 0.00000 | val_loss: 1.31597 -- iter: 128/128
--
Progress: 0.0% ... Training loss: 1.181 ... Validation loss: 1.315(128, 56) 
 (128, 1)
---------------------------------
Run id: NNXPX6
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 2  | total loss: 1.19831 | time: 1.019s
| SGD | epoch: 002 | loss: 1.19831 | val_loss: 1.60161 -- iter: 128/128
--
Progress: 0.0% ... Training loss: 1.042 ... Validation loss: 1.601(128, 56) 
 (128, 1)
---------------------------------
Run id: HTL19T
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 3  | total loss: 1.24381 | time: 1.020s
| SGD | epoch: 003 | loss: 1.24381 | val_loss: 1.29172 -- iter: 128/128
--
Progress: 0.0% ... Training loss: 1.040 ... Validation loss: 1.291(128, 56) 
 (128, 1)
---------------------------------
Run id: CG9JAT
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 4  | total loss: 1.06366 | time: 1.020s
| SGD | epoch: 004 | loss: 1.06366 | val_loss: 1.48672 -- iter: 128/128
--
Progress: 0.1% ... Training loss: 0.995 ... Validation loss: 1.486(128, 56) 
 (128, 1)
---------------------------------
Run id: 4VP4DB
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 5  | total loss: 1.00286 | time: 1.020s
| SGD | epoch: 005 | loss: 1.00286 | val_loss: 1.29043 -- iter: 128/128
--
Progress: 0.1% ... Training loss: 1.065 ... Validation loss: 1.290(128, 56) 
 (128, 1)
---------------------------------
Run id: 4NT5QA
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 6  | total loss: 1.07028 | time: 1.022s
| SGD | epoch: 006 | loss: 1.07028 | val_loss: 1.54213 -- iter: 128/128
--
Progress: 0.1% ... Training loss: 1.016 ... Validation loss: 1.542(128, 56) 
 (128, 1)
---------------------------------
Run id: 8CEAT5
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 7  | total loss: 1.01618 | time: 1.020s
| SGD | epoch: 007 | loss: 1.01618 | val_loss: 1.37073 -- iter: 128/128
--
Progress: 0.1% ... Training loss: 0.973 ... Validation loss: 1.370(128, 56) 
 (128, 1)
---------------------------------
Run id: 6KACPP
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 8  | total loss: 0.92978 | time: 1.018s
| SGD | epoch: 008 | loss: 0.92978 | val_loss: 1.42802 -- iter: 128/128
--
Progress: 0.1% ... Training loss: 0.979 ... Validation loss: 1.428(128, 56) 
 (128, 1)
---------------------------------
Run id: XLIZHO
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 9  | total loss: 0.91209 | time: 1.021s
| SGD | epoch: 009 | loss: 0.91209 | val_loss: 1.29656 -- iter: 128/128
--
Progress: 0.2% ... Training loss: 1.021 ... Validation loss: 1.296(128, 56) 
 (128, 1)
---------------------------------
Run id: Y5QMAE
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 10  | total loss: 1.07642 | time: 1.020s
| SGD | epoch: 010 | loss: 1.07642 | val_loss: 1.49745 -- iter: 128/128
--
Progress: 0.2% ... Training loss: 0.999 ... Validation loss: 1.497(128, 56) 
 (128, 1)
---------------------------------
Run id: X6DDEQ
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 11  | total loss: 1.07295 | time: 1.022s
| SGD | epoch: 011 | loss: 1.07295 | val_loss: 1.30628 -- iter: 128/128
--
Progress: 0.2% ... Training loss: 1.002 ... Validation loss: 1.306(128, 56) 
 (128, 1)
---------------------------------
Run id: KMJ3VV
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 12  | total loss: 1.11069 | time: 1.021s
| SGD | epoch: 012 | loss: 1.11069 | val_loss: 1.37896 -- iter: 128/128
--
Progress: 0.2% ... Training loss: 0.973 ... Validation loss: 1.378(128, 56) 
 (128, 1)
---------------------------------
Run id: N0KNXJ
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 13  | total loss: 0.96485 | time: 1.020s
| SGD | epoch: 013 | loss: 0.96485 | val_loss: 1.37668 -- iter: 128/128
--
Progress: 0.2% ... Training loss: 0.973 ... Validation loss: 1.376(128, 56) 
 (128, 1)
---------------------------------
Run id: OGKMAO
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 14  | total loss: 0.94536 | time: 1.018s
| SGD | epoch: 014 | loss: 0.94536 | val_loss: 1.29876 -- iter: 128/128
--
Progress: 0.3% ... Training loss: 1.015 ... Validation loss: 1.298(128, 56) 
 (128, 1)
---------------------------------
Run id: S9G7I0
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 15  | total loss: 1.05903 | time: 1.022s
| SGD | epoch: 015 | loss: 1.05903 | val_loss: 1.41284 -- iter: 128/128
--
Progress: 0.3% ... Training loss: 0.976 ... Validation loss: 1.412(128, 56) 
 (128, 1)
---------------------------------
Run id: F0WO0C
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 16  | total loss: 1.03458 | time: 1.023s
| SGD | epoch: 016 | loss: 1.03458 | val_loss: 1.31344 -- iter: 128/128
--
Progress: 0.3% ... Training loss: 0.994 ... Validation loss: 1.313(128, 56) 
 (128, 1)
---------------------------------
Run id: OKI4EA
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 17  | total loss: 1.08079 | time: 1.020s
| SGD | epoch: 017 | loss: 1.08079 | val_loss: 1.30672 -- iter: 128/128
--
Progress: 0.3% ... Training loss: 1.001 ... Validation loss: 1.306(128, 56) 
 (128, 1)
---------------------------------
Run id: Y3ZPPT
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 18  | total loss: 1.16635 | time: 1.024s
| SGD | epoch: 018 | loss: 1.16635 | val_loss: 1.93491 -- iter: 128/128
--
Progress: 0.3% ... Training loss: 1.230 ... Validation loss: 1.934(128, 56) 
 (128, 1)
---------------------------------
Run id: T5P1SE
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 19  | total loss: 1.06965 | time: 1.021s
| SGD | epoch: 019 | loss: 1.06965 | val_loss: 1.29144 -- iter: 128/128
--
Progress: 0.4% ... Training loss: 1.046 ... Validation loss: 1.291(128, 56) 
 (128, 1)
---------------------------------
Run id: 9AG5UQ
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 20  | total loss: 1.01178 | time: 1.019s
| SGD | epoch: 020 | loss: 1.01178 | val_loss: 1.41109 -- iter: 128/128
--
Progress: 0.4% ... Training loss: 0.975 ... Validation loss: 1.411(128, 56) 
 (128, 1)
---------------------------------
Run id: AE0WYO
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 21  | total loss: 1.06149 | time: 1.020s
| SGD | epoch: 021 | loss: 1.06149 | val_loss: 1.38434 -- iter: 128/128
--
Progress: 0.4% ... Training loss: 0.973 ... Validation loss: 1.384(128, 56) 
 (128, 1)
---------------------------------
Run id: 93IQ2K
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 22  | total loss: 1.03837 | time: 1.020s
| SGD | epoch: 022 | loss: 1.03837 | val_loss: 1.43180 -- iter: 128/128
--
Progress: 0.4% ... Training loss: 0.979 ... Validation loss: 1.431(128, 56) 
 (128, 1)
---------------------------------
Run id: XYYXEK
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 23  | total loss: 1.00093 | time: 1.024s
| SGD | epoch: 023 | loss: 1.00093 | val_loss: 1.30838 -- iter: 128/128
--
Progress: 0.4% ... Training loss: 0.999 ... Validation loss: 1.308(128, 56) 
 (128, 1)
---------------------------------
Run id: E5O7DC
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 24  | total loss: 0.96376 | time: 1.021s
| SGD | epoch: 024 | loss: 0.96376 | val_loss: 1.77343 -- iter: 128/128
--
Progress: 0.5% ... Training loss: 1.131 ... Validation loss: 1.773(128, 56) 
 (128, 1)
---------------------------------
Run id: T3IZ64
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 25  | total loss: 0.94539 | time: 1.025s
| SGD | epoch: 025 | loss: 0.94539 | val_loss: 1.29473 -- iter: 128/128
--
Progress: 0.5% ... Training loss: 1.026 ... Validation loss: 1.294(128, 56) 
 (128, 1)
---------------------------------
Run id: ZV8AQS
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 26  | total loss: 0.97769 | time: 1.022s
| SGD | epoch: 026 | loss: 0.97769 | val_loss: 1.74132 -- iter: 128/128
--
Progress: 0.5% ... Training loss: 1.112 ... Validation loss: 1.741(128, 56) 
 (128, 1)
---------------------------------
Run id: WNUKN8
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 27  | total loss: 0.99315 | time: 1.023s
| SGD | epoch: 027 | loss: 0.99315 | val_loss: 1.29536 -- iter: 128/128
--
Progress: 0.5% ... Training loss: 1.106 ... Validation loss: 1.295(128, 56) 
 (128, 1)
---------------------------------
Run id: OX7GUU
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 28  | total loss: 0.99287 | time: 1.021s
| SGD | epoch: 028 | loss: 0.99287 | val_loss: 1.71040 -- iter: 128/128
--
Progress: 0.5% ... Training loss: 1.095 ... Validation loss: 1.710(128, 56) 
 (128, 1)
---------------------------------
Run id: NURDZH
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 29  | total loss: 1.03072 | time: 1.022s
| SGD | epoch: 029 | loss: 1.03072 | val_loss: 1.29091 -- iter: 128/128
--
Progress: 0.6% ... Training loss: 1.063 ... Validation loss: 1.290(128, 56) 
 (128, 1)
---------------------------------
Run id: SWY5WA
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 30  | total loss: 1.06245 | time: 1.021s
| SGD | epoch: 030 | loss: 1.06245 | val_loss: 1.46075 -- iter: 128/128
--
Progress: 0.6% ... Training loss: 0.985 ... Validation loss: 1.460(128, 56) 
 (128, 1)
---------------------------------
Run id: 6E1W6J
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 31  | total loss: 1.07070 | time: 1.022s
| SGD | epoch: 031 | loss: 1.07070 | val_loss: 1.31886 -- iter: 128/128
--
Progress: 0.6% ... Training loss: 0.989 ... Validation loss: 1.318(128, 56) 
 (128, 1)
---------------------------------
Run id: DT1BHL
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 32  | total loss: 1.07881 | time: 1.023s
| SGD | epoch: 032 | loss: 1.07881 | val_loss: 1.58113 -- iter: 128/128
--
Progress: 0.6% ... Training loss: 1.030 ... Validation loss: 1.581(128, 56) 
 (128, 1)
---------------------------------
Run id: M7BWA9
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 33  | total loss: 1.00900 | time: 1.032s
| SGD | epoch: 033 | loss: 1.00900 | val_loss: 1.37379 -- iter: 128/128
--
Progress: 0.6% ... Training loss: 0.972 ... Validation loss: 1.373(128, 56) 
 (128, 1)
---------------------------------
Run id: 92USZO
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 34  | total loss: 0.95329 | time: 1.028s
| SGD | epoch: 034 | loss: 0.95329 | val_loss: 1.29307 -- iter: 128/128
--
Progress: 0.7% ... Training loss: 1.035 ... Validation loss: 1.293(128, 56) 
 (128, 1)
---------------------------------
Run id: DU6ARM
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 35  | total loss: 0.97604 | time: 1.029s
| SGD | epoch: 035 | loss: 0.97604 | val_loss: 1.48864 -- iter: 128/128
--
Progress: 0.7% ... Training loss: 0.993 ... Validation loss: 1.488(128, 56) 
 (128, 1)
---------------------------------
Run id: Z4EEEG
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 36  | total loss: 1.00041 | time: 1.024s
| SGD | epoch: 036 | loss: 1.00041 | val_loss: 1.33425 -- iter: 128/128
--
Progress: 0.7% ... Training loss: 0.980 ... Validation loss: 1.334(128, 56) 
 (128, 1)
---------------------------------
Run id: ZVRLAA
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 37  | total loss: 1.00581 | time: 1.018s
| SGD | epoch: 037 | loss: 1.00581 | val_loss: 1.46076 -- iter: 128/128
--
Progress: 0.7% ... Training loss: 0.985 ... Validation loss: 1.460(128, 56) 
 (128, 1)
---------------------------------
Run id: NWLJHA
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 38  | total loss: 0.98926 | time: 1.023s
| SGD | epoch: 038 | loss: 0.98926 | val_loss: 1.29442 -- iter: 128/128
--
Progress: 0.7% ... Training loss: 1.099 ... Validation loss: 1.294(128, 56) 
 (128, 1)
---------------------------------
Run id: R92K5I
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 39  | total loss: 1.02936 | time: 1.021s
| SGD | epoch: 039 | loss: 1.02936 | val_loss: 1.81226 -- iter: 128/128
--
Progress: 0.8% ... Training loss: 1.152 ... Validation loss: 1.812(128, 56) 
 (128, 1)
---------------------------------
Run id: 4YOWSZ
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 40  | total loss: 1.02451 | time: 1.023s
| SGD | epoch: 040 | loss: 1.02451 | val_loss: 1.30204 -- iter: 128/128
--
Progress: 0.8% ... Training loss: 1.134 ... Validation loss: 1.302(128, 56) 
 (128, 1)
---------------------------------
Run id: 4HUPNL
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 41  | total loss: 1.06012 | time: 1.024s
| SGD | epoch: 041 | loss: 1.06012 | val_loss: 1.48516 -- iter: 128/128
--
Progress: 0.8% ... Training loss: 0.992 ... Validation loss: 1.485(128, 56) 
 (128, 1)
---------------------------------
Run id: TCAECF
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 42  | total loss: 1.11997 | time: 1.024s
| SGD | epoch: 042 | loss: 1.11997 | val_loss: 1.29115 -- iter: 128/128
--
Progress: 0.8% ... Training loss: 1.062 ... Validation loss: 1.291(128, 56) 
 (128, 1)
---------------------------------
Run id: IXZ8N7
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 43  | total loss: 1.14579 | time: 1.019s
| SGD | epoch: 043 | loss: 1.14579 | val_loss: 1.54040 -- iter: 128/128
--
Progress: 0.8% ... Training loss: 1.012 ... Validation loss: 1.540(128, 56) 
 (128, 1)
---------------------------------
Run id: CJSPQ4
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 44  | total loss: 1.12147 | time: 1.022s
| SGD | epoch: 044 | loss: 1.12147 | val_loss: 1.36445 -- iter: 128/128
--
Progress: 0.9% ... Training loss: 0.972 ... Validation loss: 1.364(128, 56) 
 (128, 1)
---------------------------------
Run id: ON20C2
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 45  | total loss: 1.07933 | time: 1.024s
| SGD | epoch: 045 | loss: 1.07933 | val_loss: 1.32847 -- iter: 128/128
--
Progress: 0.9% ... Training loss: 0.982 ... Validation loss: 1.328(128, 56) 
 (128, 1)
---------------------------------
Run id: NSR9I5
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 46  | total loss: 1.09026 | time: 1.022s
| SGD | epoch: 046 | loss: 1.09026 | val_loss: 1.63342 -- iter: 128/128
--
Progress: 0.9% ... Training loss: 1.054 ... Validation loss: 1.633(128, 56) 
 (128, 1)
---------------------------------
Run id: 7KKNJZ
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 47  | total loss: 1.07410 | time: 1.022s
| SGD | epoch: 047 | loss: 1.07410 | val_loss: 1.30576 -- iter: 128/128
--
Progress: 0.9% ... Training loss: 1.002 ... Validation loss: 1.305(128, 56) 
 (128, 1)
---------------------------------
Run id: YT60W2
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 48  | total loss: 1.06036 | time: 1.022s
| SGD | epoch: 048 | loss: 1.06036 | val_loss: 1.36785 -- iter: 128/128
--
Progress: 0.9% ... Training loss: 0.972 ... Validation loss: 1.367(128, 56) 
 (128, 1)
---------------------------------
Run id: 3WHOX7
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 49  | total loss: 1.06345 | time: 1.021s
| SGD | epoch: 049 | loss: 1.06345 | val_loss: 1.32060 -- iter: 128/128
--
Progress: 1.0% ... Training loss: 0.987 ... Validation loss: 1.320(128, 56) 
 (128, 1)
---------------------------------
Run id: RQ77GO
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 50  | total loss: 1.05947 | time: 1.022s
| SGD | epoch: 050 | loss: 1.05947 | val_loss: 1.36510 -- iter: 128/128
--
Progress: 1.0% ... Training loss: 0.972 ... Validation loss: 1.365(128, 56) 
 (128, 1)
---------------------------------
Run id: GJ25ZU
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 51  | total loss: 1.04120 | time: 1.023s
| SGD | epoch: 051 | loss: 1.04120 | val_loss: 1.40928 -- iter: 128/128
--
Progress: 1.0% ... Training loss: 0.974 ... Validation loss: 1.409(128, 56) 
 (128, 1)
---------------------------------
Run id: V5IF7O
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 52  | total loss: 1.02057 | time: 1.021s
| SGD | epoch: 052 | loss: 1.02057 | val_loss: 1.52787 -- iter: 128/128
--
Progress: 1.0% ... Training loss: 1.007 ... Validation loss: 1.527(128, 56) 
 (128, 1)
---------------------------------
Run id: N4BZYB
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 53  | total loss: 0.99239 | time: 1.024s
| SGD | epoch: 053 | loss: 0.99239 | val_loss: 1.31248 -- iter: 128/128
--
Progress: 1.0% ... Training loss: 0.994 ... Validation loss: 1.312(128, 56) 
 (128, 1)
---------------------------------
Run id: 0S328Q
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 54  | total loss: 0.98080 | time: 1.020s
| SGD | epoch: 054 | loss: 0.98080 | val_loss: 1.43361 -- iter: 128/128
--
Progress: 1.1% ... Training loss: 0.977 ... Validation loss: 1.433(128, 56) 
 (128, 1)
---------------------------------
Run id: 7WHB7E
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 55  | total loss: 0.97033 | time: 1.019s
| SGD | epoch: 055 | loss: 0.97033 | val_loss: 1.29351 -- iter: 128/128
--
Progress: 1.1% ... Training loss: 1.094 ... Validation loss: 1.293(128, 56) 
 (128, 1)
---------------------------------
Run id: SZZSCI
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 56  | total loss: 1.00349 | time: 1.021s
| SGD | epoch: 056 | loss: 1.00349 | val_loss: 1.66496 -- iter: 128/128
--
Progress: 1.1% ... Training loss: 1.068 ... Validation loss: 1.664(128, 56) 
 (128, 1)
---------------------------------
Run id: F5Y1DG
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 57  | total loss: 1.03033 | time: 1.021s
| SGD | epoch: 057 | loss: 1.03033 | val_loss: 1.35246 -- iter: 128/128
--
Progress: 1.1% ... Training loss: 0.973 ... Validation loss: 1.352(128, 56) 
 (128, 1)
---------------------------------
Run id: TZNSBV
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 58  | total loss: 1.02098 | time: 1.021s
| SGD | epoch: 058 | loss: 1.02098 | val_loss: 1.47602 -- iter: 128/128
--
Progress: 1.1% ... Training loss: 0.988 ... Validation loss: 1.476(128, 56) 
 (128, 1)
---------------------------------
Run id: IOLTPM
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 59  | total loss: 0.99477 | time: 1.020s
| SGD | epoch: 059 | loss: 0.99477 | val_loss: 1.29529 -- iter: 128/128
--
Progress: 1.2% ... Training loss: 1.024 ... Validation loss: 1.295(128, 56) 
 (128, 1)
---------------------------------
Run id: 693XFC
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 60  | total loss: 1.03511 | time: 1.020s
| SGD | epoch: 060 | loss: 1.03511 | val_loss: 1.64402 -- iter: 128/128
--
Progress: 1.2% ... Training loss: 1.058 ... Validation loss: 1.644(128, 56) 
 (128, 1)
---------------------------------
Run id: 29FK0J
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 61  | total loss: 1.01117 | time: 1.020s
| SGD | epoch: 061 | loss: 1.01117 | val_loss: 1.30992 -- iter: 128/128
--
Progress: 1.2% ... Training loss: 1.162 ... Validation loss: 1.309(128, 56) 
 (128, 1)
---------------------------------
Run id: 4BWKD6
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 62  | total loss: 1.04668 | time: 1.022s
| SGD | epoch: 062 | loss: 1.04668 | val_loss: 1.46767 -- iter: 128/128
--
Progress: 1.2% ... Training loss: 0.985 ... Validation loss: 1.467(128, 56) 
 (128, 1)
---------------------------------
Run id: FGYMVY
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 63  | total loss: 1.10471 | time: 1.020s
| SGD | epoch: 063 | loss: 1.10471 | val_loss: 1.36539 -- iter: 128/128
--
Progress: 1.2% ... Training loss: 0.971 ... Validation loss: 1.365(128, 56) 
 (128, 1)
---------------------------------
Run id: 3N80HK
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 64  | total loss: 1.10813 | time: 1.022s
| SGD | epoch: 064 | loss: 1.10813 | val_loss: 1.64176 -- iter: 128/128
--
Progress: 1.3% ... Training loss: 1.056 ... Validation loss: 1.641(128, 56) 
 (128, 1)
---------------------------------
Run id: NTI3QL
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 65  | total loss: 1.04609 | time: 1.023s
| SGD | epoch: 065 | loss: 1.04609 | val_loss: 1.32175 -- iter: 128/128
--
Progress: 1.3% ... Training loss: 0.986 ... Validation loss: 1.321(128, 56) 
 (128, 1)
---------------------------------
Run id: JWFUQG
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 66  | total loss: 1.03463 | time: 1.020s
| SGD | epoch: 066 | loss: 1.03463 | val_loss: 1.77191 -- iter: 128/128
--
Progress: 1.3% ... Training loss: 1.126 ... Validation loss: 1.771(128, 56) 
 (128, 1)
---------------------------------
Run id: 6IF7SA
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 67  | total loss: 1.02747 | time: 1.023s
| SGD | epoch: 067 | loss: 1.02747 | val_loss: 1.29075 -- iter: 128/128
--
Progress: 1.3% ... Training loss: 1.070 ... Validation loss: 1.290(128, 56) 
 (128, 1)
---------------------------------
Run id: 8Z25D1
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 68  | total loss: 1.06388 | time: 1.021s
| SGD | epoch: 068 | loss: 1.06388 | val_loss: 1.70967 -- iter: 128/128
--
Progress: 1.3% ... Training loss: 1.092 ... Validation loss: 1.709(128, 56) 
 (128, 1)
---------------------------------
Run id: 2F8WY9
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 69  | total loss: 1.05454 | time: 1.026s
| SGD | epoch: 069 | loss: 1.05454 | val_loss: 1.29129 -- iter: 128/128
--
Progress: 1.4% ... Training loss: 1.040 ... Validation loss: 1.291(128, 56) 
 (128, 1)
---------------------------------
Run id: QJ6OQ0
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 70  | total loss: 1.06706 | time: 1.022s
| SGD | epoch: 070 | loss: 1.06706 | val_loss: 1.84988 -- iter: 128/128
--
Progress: 1.4% ... Training loss: 1.172 ... Validation loss: 1.849(128, 56) 
 (128, 1)
---------------------------------
Run id: QU4G3K
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 71  | total loss: 1.06415 | time: 1.027s
| SGD | epoch: 071 | loss: 1.06415 | val_loss: 1.29375 -- iter: 128/128
--
Progress: 1.4% ... Training loss: 1.027 ... Validation loss: 1.293(128, 56) 
 (128, 1)
---------------------------------
Run id: PUKBNO
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 72  | total loss: 1.06454 | time: 1.019s
| SGD | epoch: 072 | loss: 1.06454 | val_loss: 1.62680 -- iter: 128/128
--
Progress: 1.4% ... Training loss: 1.049 ... Validation loss: 1.626(128, 56) 
 (128, 1)
---------------------------------
Run id: ZUTGE0
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 73  | total loss: 1.05055 | time: 1.023s
| SGD | epoch: 073 | loss: 1.05055 | val_loss: 1.30127 -- iter: 128/128
--
Progress: 1.4% ... Training loss: 1.008 ... Validation loss: 1.301(128, 56) 
 (128, 1)
---------------------------------
Run id: EIIG0C
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 74  | total loss: 1.06177 | time: 1.022s
| SGD | epoch: 074 | loss: 1.06177 | val_loss: 1.67336 -- iter: 128/128
--
Progress: 1.5% ... Training loss: 1.073 ... Validation loss: 1.673(128, 56) 
 (128, 1)
---------------------------------
Run id: 6RKH68
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 75  | total loss: 1.03457 | time: 1.023s
| SGD | epoch: 075 | loss: 1.03457 | val_loss: 1.31256 -- iter: 128/128
--
Progress: 1.5% ... Training loss: 0.993 ... Validation loss: 1.312(128, 56) 
 (128, 1)
---------------------------------
Run id: KIQ533
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 76  | total loss: 1.05064 | time: 1.021s
| SGD | epoch: 076 | loss: 1.05064 | val_loss: 1.39187 -- iter: 128/128
--
Progress: 1.5% ... Training loss: 0.970 ... Validation loss: 1.391(128, 56) 
 (128, 1)
---------------------------------
Run id: QCHDMF
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 77  | total loss: 1.04671 | time: 1.025s
| SGD | epoch: 077 | loss: 1.04671 | val_loss: 1.29323 -- iter: 128/128
--
Progress: 1.5% ... Training loss: 1.029 ... Validation loss: 1.293(128, 56) 
 (128, 1)
---------------------------------
Run id: B81IHM
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 78  | total loss: 1.06862 | time: 1.018s
| SGD | epoch: 078 | loss: 1.06862 | val_loss: 1.56537 -- iter: 128/128
--
Progress: 1.5% ... Training loss: 1.021 ... Validation loss: 1.565(128, 56) 
 (128, 1)
---------------------------------
Run id: CI6C56
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 79  | total loss: 1.05833 | time: 1.023s
| SGD | epoch: 079 | loss: 1.05833 | val_loss: 1.30286 -- iter: 128/128
--
Progress: 1.6% ... Training loss: 1.005 ... Validation loss: 1.302(128, 56) 
 (128, 1)
---------------------------------
Run id: IJJUQK
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 80  | total loss: 1.06214 | time: 1.023s
| SGD | epoch: 080 | loss: 1.06214 | val_loss: 1.31801 -- iter: 128/128
--
Progress: 1.6% ... Training loss: 0.987 ... Validation loss: 1.318(128, 56) 
 (128, 1)
---------------------------------
Run id: C3BK53
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 81  | total loss: 1.07850 | time: 1.021s
| SGD | epoch: 081 | loss: 1.07850 | val_loss: 1.40111 -- iter: 128/128
--
Progress: 1.6% ... Training loss: 0.971 ... Validation loss: 1.401(128, 56) 
 (128, 1)
---------------------------------
Run id: 777U64
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 82  | total loss: 1.07630 | time: 1.023s
| SGD | epoch: 082 | loss: 1.07630 | val_loss: 1.29205 -- iter: 128/128
--
Progress: 1.6% ... Training loss: 1.089 ... Validation loss: 1.292(128, 56) 
 (128, 1)
---------------------------------
Run id: Y2XT6F
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 83  | total loss: 1.09968 | time: 1.018s
| SGD | epoch: 083 | loss: 1.09968 | val_loss: 1.53913 -- iter: 128/128
--
Progress: 1.6% ... Training loss: 1.010 ... Validation loss: 1.539(128, 56) 
 (128, 1)
---------------------------------
Run id: UOZ27R
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 84  | total loss: 1.10336 | time: 1.023s
| SGD | epoch: 084 | loss: 1.10336 | val_loss: 1.43696 -- iter: 128/128
--
Progress: 1.7% ... Training loss: 0.977 ... Validation loss: 1.436(128, 56) 
 (128, 1)
---------------------------------
Run id: 92RKVN
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 85  | total loss: 1.07605 | time: 1.026s
| SGD | epoch: 085 | loss: 1.07605 | val_loss: 1.36212 -- iter: 128/128
--
Progress: 1.7% ... Training loss: 0.971 ... Validation loss: 1.362(128, 56) 
 (128, 1)
---------------------------------
Run id: JKXLPC
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 86  | total loss: 1.07560 | time: 1.025s
| SGD | epoch: 086 | loss: 1.07560 | val_loss: 1.37862 -- iter: 128/128
--
Progress: 1.7% ... Training loss: 0.969 ... Validation loss: 1.378(128, 56) 
 (128, 1)
---------------------------------
Run id: 1YNJUW
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 87  | total loss: 1.07445 | time: 1.034s
| SGD | epoch: 087 | loss: 1.07445 | val_loss: 1.36995 -- iter: 128/128
--
Progress: 1.7% ... Training loss: 0.970 ... Validation loss: 1.369(128, 56) 
 (128, 1)
---------------------------------
Run id: ZMT53W
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 88  | total loss: 1.05994 | time: 1.024s
| SGD | epoch: 088 | loss: 1.05994 | val_loss: 1.41356 -- iter: 128/128
--
Progress: 1.7% ... Training loss: 0.972 ... Validation loss: 1.413(128, 56) 
 (128, 1)
---------------------------------
Run id: DGQ95Z
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 89  | total loss: 1.04861 | time: 1.018s
| SGD | epoch: 089 | loss: 1.04861 | val_loss: 1.42226 -- iter: 128/128
--
Progress: 1.8% ... Training loss: 0.974 ... Validation loss: 1.422(128, 56) 
 (128, 1)
---------------------------------
Run id: BJEX0L
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 90  | total loss: 1.03780 | time: 1.022s
| SGD | epoch: 090 | loss: 1.03780 | val_loss: 1.41277 -- iter: 128/128
--
Progress: 1.8% ... Training loss: 0.972 ... Validation loss: 1.412(128, 56) 
 (128, 1)
---------------------------------
Run id: XQ9PWP
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 91  | total loss: 1.03908 | time: 1.030s
| SGD | epoch: 091 | loss: 1.03908 | val_loss: 1.29538 -- iter: 128/128
--
Progress: 1.8% ... Training loss: 1.110 ... Validation loss: 1.295(128, 56) 
 (128, 1)
---------------------------------
Run id: NZ4K3B
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 92  | total loss: 1.07554 | time: 1.024s
| SGD | epoch: 092 | loss: 1.07554 | val_loss: 1.60401 -- iter: 128/128
--
Progress: 1.8% ... Training loss: 1.038 ... Validation loss: 1.604(128, 56) 
 (128, 1)
---------------------------------
Run id: N0YI31
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 93  | total loss: 1.08867 | time: 1.025s
| SGD | epoch: 093 | loss: 1.08867 | val_loss: 1.28915 -- iter: 128/128
--
Progress: 1.8% ... Training loss: 1.059 ... Validation loss: 1.289(128, 56) 
 (128, 1)
---------------------------------
Run id: UGHDS9
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 94  | total loss: 1.07612 | time: 1.025s
| SGD | epoch: 094 | loss: 1.07612 | val_loss: 1.52296 -- iter: 128/128
--
Progress: 1.9% ... Training loss: 1.004 ... Validation loss: 1.522(128, 56) 
 (128, 1)
---------------------------------
Run id: OIJR6R
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 95  | total loss: 1.05840 | time: 1.018s
| SGD | epoch: 095 | loss: 1.05840 | val_loss: 1.28925 -- iter: 128/128
--
Progress: 1.9% ... Training loss: 1.066 ... Validation loss: 1.289(128, 56) 
 (128, 1)
---------------------------------
Run id: QH832M
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 96  | total loss: 1.09604 | time: 1.025s
| SGD | epoch: 096 | loss: 1.09604 | val_loss: 1.41658 -- iter: 128/128
--
Progress: 1.9% ... Training loss: 0.972 ... Validation loss: 1.416(128, 56) 
 (128, 1)
---------------------------------
Run id: QJYVKI
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 97  | total loss: 1.09480 | time: 1.022s
| SGD | epoch: 097 | loss: 1.09480 | val_loss: 1.45147 -- iter: 128/128
--
Progress: 1.9% ... Training loss: 0.979 ... Validation loss: 1.451(128, 56) 
 (128, 1)
---------------------------------
Run id: PVA2R1
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 98  | total loss: 1.06298 | time: 1.025s
| SGD | epoch: 098 | loss: 1.06298 | val_loss: 1.39500 -- iter: 128/128
--
Progress: 1.9% ... Training loss: 0.969 ... Validation loss: 1.395(128, 56) 
 (128, 1)
---------------------------------
Run id: 5WYMZP
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 99  | total loss: 1.04589 | time: 1.022s
| SGD | epoch: 099 | loss: 1.04589 | val_loss: 1.32346 -- iter: 128/128
--
Progress: 2.0% ... Training loss: 0.981 ... Validation loss: 1.323(128, 56) 
 (128, 1)
---------------------------------
Run id: BSM3X6
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 100  | total loss: 1.05911 | time: 1.025s
| SGD | epoch: 100 | loss: 1.05911 | val_loss: 1.32894 -- iter: 128/128
--
Progress: 2.0% ... Training loss: 0.978 ... Validation loss: 1.328(128, 56) 
 (128, 1)
---------------------------------
Run id: R1LI4R
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 101  | total loss: 1.05611 | time: 1.020s
| SGD | epoch: 101 | loss: 1.05611 | val_loss: 1.63886 -- iter: 128/128
--
Progress: 2.0% ... Training loss: 1.054 ... Validation loss: 1.638(128, 56) 
 (128, 1)
---------------------------------
Run id: N7QQGR
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 102  | total loss: 1.02702 | time: 1.024s
| SGD | epoch: 102 | loss: 1.02702 | val_loss: 1.34900 -- iter: 128/128
--
Progress: 2.0% ... Training loss: 0.971 ... Validation loss: 1.349(128, 56) 
 (128, 1)
---------------------------------
Run id: UG2RDQ
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 103  | total loss: 1.00626 | time: 1.024s
| SGD | epoch: 103 | loss: 1.00626 | val_loss: 1.35846 -- iter: 128/128
--
Progress: 2.0% ... Training loss: 0.969 ... Validation loss: 1.358(128, 56) 
 (128, 1)
---------------------------------
Run id: M7673Q
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 104  | total loss: 1.01174 | time: 1.023s
| SGD | epoch: 104 | loss: 1.01174 | val_loss: 1.49843 -- iter: 128/128
--
Progress: 2.1% ... Training loss: 0.993 ... Validation loss: 1.498(128, 56) 
 (128, 1)
---------------------------------
Run id: 2PCS6L
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 105  | total loss: 0.98481 | time: 1.022s
| SGD | epoch: 105 | loss: 0.98481 | val_loss: 1.32264 -- iter: 128/128
--
Progress: 2.1% ... Training loss: 0.981 ... Validation loss: 1.322(128, 56) 
 (128, 1)
---------------------------------
Run id: QVMKOG
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 106  | total loss: 0.98057 | time: 1.021s
| SGD | epoch: 106 | loss: 0.98057 | val_loss: 1.50992 -- iter: 128/128
--
Progress: 2.1% ... Training loss: 0.997 ... Validation loss: 1.509(128, 56) 
 (128, 1)
---------------------------------
Run id: Z4OIYC
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 107  | total loss: 0.97170 | time: 1.020s
| SGD | epoch: 107 | loss: 0.97170 | val_loss: 1.31348 -- iter: 128/128
--
Progress: 2.1% ... Training loss: 0.988 ... Validation loss: 1.313(128, 56) 
 (128, 1)
---------------------------------
Run id: MCFDMG
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 108  | total loss: 0.97579 | time: 1.023s
| SGD | epoch: 108 | loss: 0.97579 | val_loss: 1.34608 -- iter: 128/128
--
Progress: 2.1% ... Training loss: 0.971 ... Validation loss: 1.346(128, 56) 
 (128, 1)
---------------------------------
Run id: TXEYUR
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 109  | total loss: 0.97773 | time: 1.021s
| SGD | epoch: 109 | loss: 0.97773 | val_loss: 1.36211 -- iter: 128/128
--
Progress: 2.2% ... Training loss: 0.968 ... Validation loss: 1.362(128, 56) 
 (128, 1)
---------------------------------
Run id: X7YT6A
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 110  | total loss: 0.97745 | time: 1.021s
| SGD | epoch: 110 | loss: 0.97745 | val_loss: 1.63560 -- iter: 128/128
--
Progress: 2.2% ... Training loss: 1.052 ... Validation loss: 1.635(128, 56) 
 (128, 1)
---------------------------------
Run id: 98PVPI
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 111  | total loss: 0.96126 | time: 1.022s
| SGD | epoch: 111 | loss: 0.96126 | val_loss: 1.29097 -- iter: 128/128
--
Progress: 2.2% ... Training loss: 1.031 ... Validation loss: 1.290(128, 56) 
 (128, 1)
---------------------------------
Run id: F25HQF
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 112  | total loss: 0.97702 | time: 1.020s
| SGD | epoch: 112 | loss: 0.97702 | val_loss: 1.56821 -- iter: 128/128
--
Progress: 2.2% ... Training loss: 1.020 ... Validation loss: 1.568(128, 56) 
 (128, 1)
---------------------------------
Run id: 334ODH
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 113  | total loss: 0.97691 | time: 1.022s
| SGD | epoch: 113 | loss: 0.97691 | val_loss: 1.33997 -- iter: 128/128
--
Progress: 2.2% ... Training loss: 0.973 ... Validation loss: 1.339(128, 56) 
 (128, 1)
---------------------------------
Run id: O3BENK
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 114  | total loss: 0.96126 | time: 1.023s
| SGD | epoch: 114 | loss: 0.96126 | val_loss: 1.58872 -- iter: 128/128
--
Progress: 2.3% ... Training loss: 1.029 ... Validation loss: 1.588(128, 56) 
 (128, 1)
---------------------------------
Run id: 3D3MTH
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 115  | total loss: 0.96096 | time: 1.026s
| SGD | epoch: 115 | loss: 0.96096 | val_loss: 1.29478 -- iter: 128/128
--
Progress: 2.3% ... Training loss: 1.016 ... Validation loss: 1.294(128, 56) 
 (128, 1)
---------------------------------
Run id: FFD4HV
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 116  | total loss: 0.98692 | time: 1.023s
| SGD | epoch: 116 | loss: 0.98692 | val_loss: 1.40945 -- iter: 128/128
--
Progress: 2.3% ... Training loss: 0.970 ... Validation loss: 1.409(128, 56) 
 (128, 1)
---------------------------------
Run id: SEIMAY
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 117  | total loss: 1.01779 | time: 1.024s
| SGD | epoch: 117 | loss: 1.01779 | val_loss: 1.37687 -- iter: 128/128
--
Progress: 2.3% ... Training loss: 0.967 ... Validation loss: 1.376(128, 56) 
 (128, 1)
---------------------------------
Run id: S1HK8E
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 118  | total loss: 0.99348 | time: 1.021s
| SGD | epoch: 118 | loss: 0.99348 | val_loss: 1.44372 -- iter: 128/128
--
Progress: 2.3% ... Training loss: 0.976 ... Validation loss: 1.443(128, 56) 
 (128, 1)
---------------------------------
Run id: X8MPQ2
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 119  | total loss: 0.96995 | time: 1.029s
| SGD | epoch: 119 | loss: 0.96995 | val_loss: 1.31995 -- iter: 128/128
--
Progress: 2.4% ... Training loss: 0.983 ... Validation loss: 1.319(128, 56) 
 (128, 1)
---------------------------------
Run id: NWWBYG
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 120  | total loss: 0.97483 | time: 1.024s
| SGD | epoch: 120 | loss: 0.97483 | val_loss: 1.60110 -- iter: 128/128
--
Progress: 2.4% ... Training loss: 1.035 ... Validation loss: 1.601(128, 56) 
 (128, 1)
---------------------------------
Run id: 00C4QV
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 121  | total loss: 0.94584 | time: 1.026s
| SGD | epoch: 121 | loss: 0.94584 | val_loss: 1.31945 -- iter: 128/128
--
Progress: 2.4% ... Training loss: 0.983 ... Validation loss: 1.319(128, 56) 
 (128, 1)
---------------------------------
Run id: Q22PLI
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 122  | total loss: 0.95043 | time: 1.025s
| SGD | epoch: 122 | loss: 0.95043 | val_loss: 1.58710 -- iter: 128/128
--
Progress: 2.4% ... Training loss: 1.028 ... Validation loss: 1.587(128, 56) 
 (128, 1)
---------------------------------
Run id: BOWMUC
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 123  | total loss: 0.93537 | time: 1.023s
| SGD | epoch: 123 | loss: 0.93537 | val_loss: 1.30902 -- iter: 128/128
--
Progress: 2.4% ... Training loss: 0.991 ... Validation loss: 1.309(128, 56) 
 (128, 1)
---------------------------------
Run id: GRYYK6
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 124  | total loss: 0.94336 | time: 1.022s
| SGD | epoch: 124 | loss: 0.94336 | val_loss: 1.42348 -- iter: 128/128
--
Progress: 2.5% ... Training loss: 0.971 ... Validation loss: 1.423(128, 56) 
 (128, 1)
---------------------------------
Run id: L91TFX
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 125  | total loss: 0.94531 | time: 1.021s
| SGD | epoch: 125 | loss: 0.94531 | val_loss: 1.35756 -- iter: 128/128
--
Progress: 2.5% ... Training loss: 0.966 ... Validation loss: 1.357(128, 56) 
 (128, 1)
---------------------------------
Run id: CPPBDS
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 126  | total loss: 0.97717 | time: 1.024s
| SGD | epoch: 126 | loss: 0.97717 | val_loss: 1.32459 -- iter: 128/128
--
Progress: 2.5% ... Training loss: 0.977 ... Validation loss: 1.324(128, 56) 
 (128, 1)
---------------------------------
Run id: LJ8HWF
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 127  | total loss: 0.99260 | time: 1.023s
| SGD | epoch: 127 | loss: 0.99260 | val_loss: 1.42970 -- iter: 128/128
--
Progress: 2.5% ... Training loss: 0.971 ... Validation loss: 1.429(128, 56) 
 (128, 1)
---------------------------------
Run id: Y47GER
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 128  | total loss: 0.99228 | time: 1.025s
| SGD | epoch: 128 | loss: 0.99228 | val_loss: 1.33286 -- iter: 128/128
--
Progress: 2.5% ... Training loss: 0.973 ... Validation loss: 1.332(128, 56) 
 (128, 1)
---------------------------------
Run id: A20986
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 129  | total loss: 0.97691 | time: 1.022s
| SGD | epoch: 129 | loss: 0.97691 | val_loss: 1.43385 -- iter: 128/128
--
Progress: 2.6% ... Training loss: 0.972 ... Validation loss: 1.433(128, 56) 
 (128, 1)
---------------------------------
Run id: WUDIWD
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
Training Step: 130  | total loss: 0.97150 | time: 1.020s
| SGD | epoch: 130 | loss: 0.97150 | val_loss: 1.36340 -- iter: 128/128
--
Progress: 2.6% ... Training loss: 0.966 ... Validation loss: 1.363(128, 56) 
 (128, 1)
---------------------------------
Run id: BOT68Y
Log directory: /tmp/tflearn_logs/
---------------------------------
Training samples: 128
Validation samples: 1440
--
---------------------------------------------------------------------------
KeyboardInterrupt                         Traceback (most recent call last)
<ipython-input-73-78cbabad31bd> in <module>()
     20     yval = yval.reshape(-1,1)
     21 
---> 22     network.train(X, y, Xval, yval)
     23 
     24     # Printing out the training progress

<ipython-input-70-b603a15418d2> in train(self, X, y, Xval, yval)
     21     def train(self, X, y, Xval,yval):
     22         print(X.shape,'\n',y.shape)
---> 23         self.model.fit(X, y, batch_size=128, n_epoch=1, validation_set=(Xval,yval))
     24 
     25     def run(self, features):

/home/ACCELEWARE/scott.quiring/.conda/envs/dlr7/lib/python3.6/site-packages/tflearn/models/dnn.py in fit(self, X_inputs, Y_targets, n_epoch, validation_set, show_metric, batch_size, shuffle, snapshot_epoch, snapshot_step, excl_trainops, validation_batch_size, run_id, callbacks)
    213                          excl_trainops=excl_trainops,
    214                          run_id=run_id,
--> 215                          callbacks=callbacks)
    216 
    217     def predict(self, X):

/home/ACCELEWARE/scott.quiring/.conda/envs/dlr7/lib/python3.6/site-packages/tflearn/helpers/trainer.py in fit(self, feed_dicts, n_epoch, val_feed_dicts, show_metric, snapshot_step, snapshot_epoch, shuffle_all, dprep_dict, daug_dict, excl_trainops, run_id, callbacks)
    331                                                        (bool(self.best_checkpoint_path) | snapshot_epoch),
    332                                                        snapshot_step,
--> 333                                                        show_metric)
    334 
    335                             # Update training state

/home/ACCELEWARE/scott.quiring/.conda/envs/dlr7/lib/python3.6/site-packages/tflearn/helpers/trainer.py in _train(self, training_step, snapshot_epoch, snapshot_step, show_metric)
    801             if show_metric and self.metric is not None:
    802                 eval_ops.append(self.metric)
--> 803             e = evaluate_flow(self.session, eval_ops, self.test_dflow)
    804             self.val_loss = e[0]
    805             if show_metric and self.metric is not None:

/home/ACCELEWARE/scott.quiring/.conda/envs/dlr7/lib/python3.6/site-packages/tflearn/helpers/trainer.py in evaluate_flow(session, ops_to_evaluate, dataflow)
    941             for i in range(len(r)):
    942                 res[i] += r[i] * current_batch_size
--> 943             feed_batch = dataflow.next()
    944         res = [r / dataflow.n_samples for r in res]
    945         return res

/home/ACCELEWARE/scott.quiring/.conda/envs/dlr7/lib/python3.6/site-packages/tflearn/data_flow.py in next(self, timeout)
    127         """
    128         self.data_status.update()
--> 129         return self.feed_dict_queue.get(timeout=timeout)
    130 
    131     def start(self, reset_status=True):

/home/ACCELEWARE/scott.quiring/.conda/envs/dlr7/lib/python3.6/queue.py in get(self, block, timeout)
    162             elif timeout is None:
    163                 while not self._qsize():
--> 164                     self.not_empty.wait()
    165             elif timeout < 0:
    166                 raise ValueError("'timeout' must be a non-negative number")

/home/ACCELEWARE/scott.quiring/.conda/envs/dlr7/lib/python3.6/threading.py in wait(self, timeout)
    293         try:    # restore state no matter what (e.g., KeyboardInterrupt)
    294             if timeout is None:
--> 295                 waiter.acquire()
    296                 gotit = True
    297             else:

KeyboardInterrupt: 

In [ ]:
fig, ax = plt.subplots(figsize=(13,6))

ax.plot(losses['train'], label='Training loss')
ax.plot(losses['validation'], label='Validation loss')
ax.set_title('it={0},lr={1},n={2} loss={3:.3f}'.format(iterations, learning_rate, hidden_nodes,
                                                   losses['validation'][-1]))
ax.grid(axis='y')
_ = ax.legend()
#_ = fig.ylim()

Check out your predictions

Here, use the test data to view how well your network is modeling the data. If something is completely wrong here, make sure each step in your network is implemented correctly.


In [82]:
fig, (ax,err) = plt.subplots(2,1, figsize=(13,13))

mean, std = scaled_features['cnt']
predictions = network.run(test_features).T*std + mean
ax.plot(predictions[0], label='Prediction')
ax.plot((test_targets['cnt']*std + mean).values, label='Data')
ax.set_xlim(right=len(predictions))
ax.legend()
ax.grid()

dates = pd.to_datetime(rides.ix[test_data.index]['dteday'])
dates = dates.apply(lambda d: d.strftime('%b %d'))
ax.set_xticks(np.arange(len(dates))[12::24])
_ = ax.set_xticklabels(dates[12::24], rotation=45)


mean, std = scaled_features['cnt']
err.plot((test_targets['cnt']*std + mean).values - predictions[0], label='Error')
err.set_xlim(right=len(predictions))

err.grid()
#ax.legend()


err.set_xticks(np.arange(len(dates))[12::24])
_ = err.set_xticklabels(dates[12::24], rotation=45)


OPTIONAL: Thinking about your results(this question will not be evaluated in the rubric).

Answer these questions about your results. How well does the model predict the data? Where does it fail? Why does it fail where it does?

Note: You can edit the text in this cell by double clicking on it. When you want to render the text, press control + enter

Your answer below

The time around Christmas and New Year's is obviously a different situation from the rest of the year. We would probably need a few years' worth of data to predict that properly.

We also seem to have trouble predicting the magnitude of the rush hour peak. Not sure what could be done there.


In [155]:
tf.reset_default_graph()

network = NeuralNetwork(N_i, hidden_nodes=12, output_nodes=2, learning_rate=.1, hidden_layers=2)

In [156]:
X = np.array(train_features)
y = np.array(train_targets.loc[:,['casual', 'registered']])
Xval = np.array(val_features)
Yval = np.array(val_targets.loc[:,['casual', 'registered']])

In [157]:
network.train(X, y, Xval, Yval, 20)


Training Step: 2419  | total loss: 0.17123 | time: 0.402s
| SGD | epoch: 020 | loss: 0.17123 -- iter: 15360/15435
Training Step: 2420  | total loss: 0.16135 | time: 1.408s
| SGD | epoch: 020 | loss: 0.16135 | val_loss: 0.15437 -- iter: 15435/15435
--

In [158]:
network.train(X, y, Xval, Yval, 20)


Training Step: 4839  | total loss: 0.07849 | time: 0.379s
| SGD | epoch: 040 | loss: 0.07849 -- iter: 15360/15435
Training Step: 4840  | total loss: 0.07913 | time: 1.385s
| SGD | epoch: 040 | loss: 0.07913 | val_loss: 0.15780 -- iter: 15435/15435
--

In [120]:
network.train(X, y, Xval, Yval, 50)


Training Step: 18149  | total loss: 0.09188 | time: 0.392s
| SGD | epoch: 150 | loss: 0.09188 -- iter: 15360/15435
Training Step: 18150  | total loss: 0.09373 | time: 1.398s
| SGD | epoch: 150 | loss: 0.09373 | val_loss: 0.16747 -- iter: 15435/15435
--

In [121]:
network.train(X, y, Xval, Yval, 50)


Training Step: 24199  | total loss: 0.08268 | time: 0.345s
| SGD | epoch: 200 | loss: 0.08268 -- iter: 15360/15435
Training Step: 24200  | total loss: 0.08081 | time: 1.351s
| SGD | epoch: 200 | loss: 0.08081 | val_loss: 0.16552 -- iter: 15435/15435
--

In [127]:
meanC, stdC = scaled_features['casual']
meanR, stdR = scaled_features['registered']
mean, std = scaled_features['cnt']

In [159]:
predictions_uns = network.run(test_features)
predictions = np.zeros((predictions_uns.shape[0], 3))

predictions[:,0] = (predictions_uns[:,0] * stdC) + meanC
predictions[:,1] = (predictions_uns[:,1] * stdR) + meanR
predictions[:,2] = predictions[:,0] + predictions[:,1]

In [160]:
fig, (ax,err) = plt.subplots(2,1, figsize=(13,13))
#ax.plot(predictions[:,0], label='Casual')
ax.plot(predictions[:,2], label='Prediction')
ax.plot((test_targets['cnt']*std + mean).values, label='Data')
ax.set_xlim(right=len(predictions))
ax.legend()
ax.grid()

dates = pd.to_datetime(rides.ix[test_data.index]['dteday'])
dates = dates.apply(lambda d: d.strftime('%b %d'))
ax.set_xticks(np.arange(len(dates))[12::24])
_ = ax.set_xticklabels(dates[12::24], rotation=45)


mean, std = scaled_features['cnt']
err.plot((test_targets['cnt']*std + mean).values - predictions[:,2].T, label='Error')
err.set_xlim(right=len(predictions))

err.grid()
#ax.legend()


err.set_xticks(np.arange(len(dates))[12::24])
_ = err.set_xticklabels(dates[12::24], rotation=45)



In [161]:
fig, (ax,err) = plt.subplots(2,1, figsize=(13,13))
ax.plot(predictions[:,0], label='Casual')
ax.plot((test_targets['casual']*stdC + meanC).values, label='Data')
ax.set_xlim(right=len(predictions))
ax.legend()
ax.grid()

dates = pd.to_datetime(rides.ix[test_data.index]['dteday'])
dates = dates.apply(lambda d: d.strftime('%b %d'))
ax.set_xticks(np.arange(len(dates))[12::24])
_ = ax.set_xticklabels(dates[12::24], rotation=45)


mean, std = scaled_features['cnt']
err.plot((test_targets['casual']*stdC + meanC).values - predictions[:,0].T, label='Error')
err.set_xlim(right=len(predictions))

err.grid()
#ax.legend()


err.set_xticks(np.arange(len(dates))[12::24])
_ = err.set_xticklabels(dates[12::24], rotation=45)



In [162]:
fig, (ax,err) = plt.subplots(2,1, figsize=(13,13))
ax.plot(predictions[:,1], label='Registered')
ax.plot((test_targets['registered']*stdR + meanR).values, label='Data')
ax.set_xlim(right=len(predictions))
ax.legend()
ax.grid()

dates = pd.to_datetime(rides.ix[test_data.index]['dteday'])
dates = dates.apply(lambda d: d.strftime('%b %d'))
ax.set_xticks(np.arange(len(dates))[12::24])
_ = ax.set_xticklabels(dates[12::24], rotation=45)


mean, std = scaled_features['cnt']
err.plot((test_targets['registered']*stdR + meanR).values - predictions[:,1].T, label='Error')
err.set_xlim(right=len(predictions))

err.grid()
#ax.legend()


err.set_xticks(np.arange(len(dates))[12::24])
_ = err.set_xticklabels(dates[12::24], rotation=45)



In [ ]: